home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
cslip.lha
/
usr
/
amiga
/
src
/
cmd
/
slattach
/
slattach.c-diff
Wrap
Text File
|
1992-11-11
|
2KB
|
93 lines
*** /usr/amiga/src/cmd/slattach/slattach.c.orig Wed Nov 11 17:55:00 1992
--- /usr/amiga/src/cmd/slattach/slattach.c Wed Nov 11 17:55:12 1992
***************
*** 27,33 ****
--- 27,39 ----
#define SLIP_WHICH_INTERFACE 'slwh'
#endif
+ #define SLIP_GET_CONF_FLAGS 'slgc'
+ #define SLIP_SET_CONF_FLAGS 'slsc'
+ #define SC_COMPRESS 0x0002 /* compress TCP traffic */
+ #define SC_NOICMP 0x0004 /* supress ICMP traffic */
+ #define SC_AUTOCOMP 0x0008 /* auto-enable TCP compression */
+
static void catch(int sig)
{
}
***************
*** 63,72 ****
int n;
char buf[512];
struct termios termios;
if (argc < 3)
{
! fprintf(stderr, "Usage: %s speed local-address remote-address [ifconfig args]\n", argv[0]);
return -1;
}
--- 69,79 ----
int n;
char buf[512];
struct termios termios;
+ int slip_flags, i;
if (argc < 3)
{
! fprintf(stderr, "Usage: %s speed local-address remote-address [autocomp][compress][noicmp] [ifconfig args]\n", argv[0]);
return -1;
}
***************
*** 96,106 ****
return 1;
}
{
- int i;
char *p = buf;
p += sprintf(p, "ifconfig sl%d", n);
for ( i=2 ; i<argc ; ++i )
p += sprintf(p, " %s", argv[i]);
p += sprintf(p, " up");
}
--- 103,138 ----
return 1;
}
+
+ for (i = 2, slip_flags = 0; i < argc; i++)
+ if (! strcmp (argv[i], "autocomp"))
+ {
+ slip_flags |= SC_AUTOCOMP;
+ argv[i] = 0;
+ }
+ else if (! strcmp (argv[i], "compress"))
+ {
+ slip_flags |= SC_COMPRESS;
+ argv[i] = 0;
+ }
+ else if (! strcmp (argv[i], "noicmp"))
+ {
+ slip_flags |= SC_NOICMP;
+ argv[i] = 0;
+ }
+
+ if (ioctl (0, SLIP_SET_CONF_FLAGS, slip_flags) < 0)
+ {
+ fprintf (stderr, "%s: SLIP_SET_CONF_FLAGS FAILED: %s\n",
+ argv[0], strerror (errno));
+ return 1;
+ }
+
{
char *p = buf;
p += sprintf(p, "ifconfig sl%d", n);
for ( i=2 ; i<argc ; ++i )
+ if (argv[i])
p += sprintf(p, " %s", argv[i]);
p += sprintf(p, " up");
}